import requests

url="https://www.sogou.com/web?query=周杰伦"
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36"
}
res = requests.get(url,headers=headers)

text = res.text

with open('mysougou.html','w',encoding='utf-8') as f:
    f.write(text)

res.close()  # 关掉,否则之后不能请求了